//////////////////////////////////////////////
// File				:	Keyboard.h
//
// Author			:	Nick Faletra (NF)
//
// Date Created		:	12/20/2013
//////////////////////////////////////////////
#ifndef _KEYBOARD_H_
#define _KEYBOARD_H_

#include "InputDevice.h"

class CKeyboard : public CInputDevice
{
	unsigned char m_ucKeysPressed[256];
	unsigned char m_ucPrevKeysPressed[256];

	unsigned char m_ucAsciiVals[256];
	HKL m_keyLayout;

	void ClearKeys();

public:
	CKeyboard(IDirectInput8* pDI, HWND hWnd, bool bExclusive = false);

	bool ReadDevice();
	bool ReadBufferedDevice();
	
	bool Acquire();
	bool Unacquire();
	
	bool KeyDown(unsigned char ucDIKey);
	bool KeyPressed(unsigned char ucDIKey);
	bool KeyPressedEx(unsigned char ucDIKey);
	bool KeyUp(unsigned char ucDIKey);
	bool KeyReleased(unsigned char ucDIKey);
	bool KeyReleasedEx(unsigned char ucDIKey);

	char CheckKeys();
	char CheckBufferedKeysEx();

	unsigned char GetDIKCode();
	unsigned char GetBufferedDIKCodeEx();
};

#endif // _KEYBOARD_H_